]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
base-icon: Enforce the requested icon size
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 10 Feb 2011 15:30:28 +0000 (16:30 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 25 Feb 2011 23:06:44 +0000 (00:06 +0100)
Mainly due to StTextureCache's way of handling fallback icons, an
implementation of BaseIcon.createIcon() may return an icon smaller
than the requested size. Given that BaseIcon is not used for isolated
elements, but rather for groups of related items (App view, Dash,
Search Results, ...), having some elements end up with the wrong
size is more annoying than having some elements end up ugly due to
scaling, so explicitly enforce the requested icon size.

https://bugzilla.gnome.org/show_bug.cgi?id=642043

js/ui/iconGrid.js

index 91cc0c3f492eed18d6e9b43fa484ff86f22cc349..f2d046cb2a7dd73ae88a1711fb47d479919f77d8 100644 (file)
@@ -126,6 +126,12 @@ BaseIcon.prototype = {
         this.icon.destroy();
         this.iconSize = size;
         this.icon = this.createIcon(this.iconSize);
+
+        // The icon returned by createIcon() might actually be smaller than
+        // the requested icon size (for instance StTextureCache does this
+        // for fallback icons), so set the size explicitly.
+        this.icon.set_size(this.iconSize, this.iconSize);
+
         this._iconBin.child = this.icon;
     },